package org.wevil.controller.sys;

import org.wevil.params.export.LogControllerEP;
import org.wevil.params.page.LogControllerPP;
import org.wevil.params.page.LogLoginPP;
import org.wevil.service.sys.LogService;
import org.wevil.vo.Result;
import org.wevil.util.page.PageResult;
import org.wevil.vo.list.LogControllerListVo;
import org.wevil.vo.list.LogLoginListVo;


import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/** 日志管理 */
@RestController
@RequestMapping("log")
public class LogController {

    @Resource
    private LogService logService;

    /** 操作日志分页 */
    @PostMapping("/controller/page")
    public Result<PageResult<LogControllerListVo>> controllerPage(
            @RequestBody LogControllerPP param
    ){
        PageResult<LogControllerListVo> data = logService.controllerPage(param);
        return Result.success(data);
    }

    /** 登录日志分页 */
    @PostMapping("/login/page")
    public Result<PageResult<LogLoginListVo>> loginPage(
            @RequestBody LogLoginPP param
    ){
        PageResult<LogLoginListVo> data = logService.loginPage(param);
        return Result.success(data);
    }

    /** 操作日志导出excel */
    @PostMapping("/controller/page/excel")
    public void controllerPageExcel(
            @RequestBody LogControllerEP param
    ){
        logService.controllerPageExcel(param);
    }
}
